<?php echo $this->element('search-form');?>
<div class="chidoansvs index">
	<h2><?php __('Danh sách các chi đoàn sinh viên ');?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo 'STT';?></th>
			<th><?php __('Mã CĐ');?></th>
			<th><?php __('Khóa học');?></th>
			<th><?php __('Tên CĐ');?></th>
			<th><?php __('Ghi chú');?></th>
			<th class="actions"><?php __('Lựa chọn');?></th>
	</tr>
<!-- search results -->
    <?php
    if(isset($results)){
        foreach($results as $result){
            echo "<td>".$result['Chidoansv']['id']."</td>";
            echo "<td>".$result['Chidoansv']['machidoansv']."</td>";
            echo "<td>".$result['Khoahoc']['id']."</td>";
            echo "<td>".$result['Chidoansv']['tenchidoan']."</td>";
            echo "<td>".$result['Chidoansv']['ghichu']."</td>";
            echo "<td>".$this->Html->link(__('Duyệt', true), array('action' => 'duyetdvut', $result['Chidoansv']['id']))."</td>";
        }
    }else if(isset($check)) echo $check;
    ?>
<!-- search results -->       
	<?php
	$i = 0;$stt=0;
	foreach ($chidoansvs as $chidoansv):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $stt=$stt+1; ?>&nbsp;</td>
		<td><?php echo $chidoansv['Chidoansv']['machidoansv']; ?>&nbsp;</td>
		<td>
			<?php echo $chidoansv['Khoahoc']['id']; ?>
		</td>
		<td><?php echo $chidoansv['Chidoansv']['tenchidoan']; ?>&nbsp;</td>
		<td><?php echo $chidoansv['Chidoansv']['ghichu']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Duyệt', true), array('action' => 'duyetdvut', $chidoansv['Chidoansv']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	
</div>
<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Danh sách khoa', true), array('controller' => 'khoas', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Danh sách năm học', true), array('controller' => 'namhocs', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('Danh sách khóa học', true), array('controller' => 'khoahocs', 'action' => 'index')); ?> </li>
	</ul>
</div>